import { Component, OnInit, Inject } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import { UtilityService} from '../../../../../../service/utils.service';
import {appConfig} from '../../../../../../service/common';
import {NzModalService, NzNotificationService} from 'ng-zorro-antd';
import {Router} from '@angular/router';
import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
import { ActivatedRoute} from '@angular/router';
import { WorkitemModule } from '../../../../../../service/delivent/workItemModule';
import { BranchModule} from '../../../../../../service/delivent/brachModule';
import * as _ from 'lodash';
import * as moment from 'moment';

@Component({
  selector: 'app-detailed',
  templateUrl: './detailed.component.html',
   styleUrls: ['./detailed.component.less']
})
export class DetailedComponent implements OnInit {

    constructor(
        private http: _HttpClient,
        private router: Router,
        private utilityService: UtilityService,
        private modal: NzModalService,
        private nznot: NzNotificationService,
        public activatedRoute: ActivatedRoute,
        @Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService,
 
    ) { }

    workGuid: string; // 工作项guid
    data: any; // 工作项日期
    token:any;
    ngOnInit() {
          this.token  = this.tokenService.get().token; 
        this.workGuid = this.activatedRoute.snapshot.params.id; // 拿到父组件传过来的操作员的guid来进行操作
        this.getData();
    }

  isSpinning = false;
     workItem: WorkitemModule = new  WorkitemModule(); 
  getData(){
      this.isSpinning = true;
      let url='/sWorkitem/'+this.workGuid+'/general'
        this.utilityService.getData(appConfig.testUrl  + url)
            .subscribe(
                (val) => {
                    this.isSpinning = false;
                    this.workItem = val.result.workitemSupplement;

                         
        },(error)=>{
               this.isSpinning = false;
                 this.nznot.create('error', error.code , error.msg);
        });
  }
    getDetail(it){
        console.log
    }
}
